<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>webview 遮罩界面</title>
		<script>
			function scanResult(result) { //监听扫码结果
				alert("result：" + result);
			}

			function closeScan() { //关闭扫码界面
				Android.closeScan();
			}

			function openAlbum() { //打开相册扫码
				Android.openAlbum();
			}

			function openLight() { //打开闪光灯
				Android.openLight();
			}

			function closeLight() { //关闭闪光灯
				Android.closeLight();
			}

			function sendObj() { //传信息给uniapp界面
				//Android.sendObj("{code:'success',msg:'消息1'}");
				Android.sendMsg("{code:'success',msg:'消息1'}");
			}

			function sendArray() { //传信息给uniapp界面
				//Android.sendArray("[{msg:'消息1'},{msg:'消息2'}]");
				Android.sendMsg("[{msg:'消息1'},{msg:'消息2'}]");
			}

			function sendMsg() { //传信息给uniapp界面
				Android.sendMsg("msg");
			}
		</script>

		<style>
			body,
			html {
				height: 100%;
				margin: 0;
				padding: 0;
			}

			p {
				margin: 0;
				padding: 0;
			}

			.box {
				width: 100%;
				height: 100%;
				//background-color: red;
			}

			.btn {
				padding: 6px;
			}
		</style>
	</head>

	<body>
		<div class="box">
			<p style="color:white;">自定义 webview 遮罩界面</p>
			<button class="btn" type="button" onclick="closeScan()">closeScan</button>
			<button class="btn" type="button" onclick="openAlbum()">openAlbum</button>
			<button class="btn" type="button" onclick="openLight()">openLight</button>
			<button class="btn" type="button" onclick="closeLight()">closeLight</button>
			<button class="btn" type="button" onclick="sendMsg()">sendMsg</button>
			<button class="btn" type="button" onclick="sendObj()">sendObj</button>
			<button class="btn" type="button" onclick="sendArray()">sendArray</button>
		</div>
	</body>
</html>
